Checking scripts for the things Xen needs for build and install.
410a94a4KT6I6X0LVc7djB39tRDp4g linux-2.6.7-xen-sparse/mm/page_alloc.c
40e1b09db5mN69Ijj0X_Eol-S7dXiw tools/Make.defs
3f776bd1Hy9rn69ntXBhPReUFw9IEA tools/Makefile
+4124b307nRyK3dhn1hAsvrY76NuV3g tools/check/Makefile
+4124b307vHLUWbfpemVefmaWDcdfag tools/check/README
+4124b307jt7T3CHysgl9LijNHSe1tA tools/check/check_brctl
+4124b307HDX972-zihuZWXB7R8Vd0w tools/check/check_curl_devel
+4124b307P3bZBkTFm6r-3XTbf0phAA tools/check/check_curl_lib
+4124b307u-FeKvFP9kZnh0rLV0XjGg tools/check/check_logging
+4124b307tRTjLqzRy60QrUoqN2Fhuw tools/check/check_python
+4124b307KcYJMtZ7r48AF-wyhyw-SQ tools/check/check_ssl_lib
+4124b307XdznSNCv97lrT3RpOdMM1A tools/check/check_twisted
+4124b307lnAATmulpXYa0M-dzxLBDA tools/check/check_zlib_devel
+4124b308ly20ptMKQoiztPyP_X68Mw tools/check/check_zlib_lib
+4124b308O8yPHMKbj4YPR_grPGZmdA tools/check/chk
401d7e160vaxMBAUSLSicuZ7AQjJ3w tools/examples/Makefile
401d7e16UgeqroJQTIhwkrDVkoWgZQ tools/examples/README
405ff55dawQyCHFEnJ067ChPRoXBBA tools/examples/init.d/xend
all:
+ $(MAKE) -C check
$(MAKE) -C libxutil
$(MAKE) -C libxc
$(MAKE) -C misc
--- /dev/null
+
+all: build
+
+# Check this machine is OK for building on.
+build:
+ ./chk build
+
+# Check this machine is OK for installing on.
+# DO NOT use this check from 'make install' in the parent
+# directory, as that target can be used to make an installable
+# copy rather than actually installing.
+install:
+ ./chk install
+
+clean:
+ ./chk clean
\ No newline at end of file
--- /dev/null
+Checks for the suitability of a machine for Xen build or install.
+To check for build suitability use
+
+ ./chk build
+
+To check for install suitability use
+
+ ./chk install
+
+The chk script will run checks in this directory and print
+the ones that failed. It prints nothing if checks succeed.
+The chk script exits with 0 on success and 1 on failure.
+
+The chk script runs executable files in this directory whose
+names begin with 'check_'. Files containing CHECK-BUILD
+are run for the build check, and files containing CHECK-INSTALL
+are run for the install check.
+
+Detailed output from the check scripts is in .chkbuild for build
+and .chkinstall for install.
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+# CHECK-INSTALL
+
+function error {
+ echo 'Check for the bridge control utils (brctl) failed.'
+ exit 1
+}
+
+brctl show || error
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+# CHECK-BUILD
+
+function error {
+ echo 'Check for libcurl includes failed.'
+ exit 1
+}
+
+set -e
+[ -e /usr/include/curl ] || error
+[ -e /usr/include/curl/curl.h ] || error
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+# CHECK-BUILD CHECK-INSTALL
+
+function error {
+ echo 'Check for CURL library failed.'
+ exit 1
+}
+
+set -e
+ldconfig -p | grep libcurl.so || error
\ No newline at end of file
--- /dev/null
+#!/usr/bin/env python
+# CHECK-INSTALL
+# -*- mode: python; -*-
+
+import os
+import sys
+
+def hline():
+ print >>sys.stderr, "*" * 70
+
+def msg(message):
+ print >>sys.stderr, "*" * 3, message
+
+def check_logging():
+ """Check python logging is installed and raise an error if not.
+ Logging is standard from Python 2.3 on.
+ """
+ try:
+ import logging
+ except ImportError:
+ hline()
+ msg("Python logging is not installed.")
+ msg("Use 'make install-logging' at the xen root to install.")
+ msg("")
+ msg("Alternatively download and install from")
+ msg("http://www.red-dove.com/python_logging.html")
+ hline()
+ sys.exit(1)
+
+if __name__ == '__main__':
+ check_logging()
--- /dev/null
+#!/bin/bash
+# CHECK-BUILD CHECK-INSTALL
+
+function error {
+ echo "Check for Python version 2.2 or higher failed."
+ exit 1
+}
+
+python -V
+python -V 2>&1 | cut -d ' ' -f 2 | grep -q -E '^2.2|^2.3|^2.4' || error
--- /dev/null
+#!/bin/bash
+# CHECK-BUILD CHECK-INSTALL
+
+function error {
+ echo "Check for ssl library failed."
+ exit 1
+}
+
+set -e
+ldconfig -p | grep libssl.so || error
\ No newline at end of file
--- /dev/null
+#!/usr/bin/env python
+# CHECK-INSTALL
+# -*- mode: python; -*-
+
+import os
+import sys
+
+def hline():
+ print >>sys.stderr, "*" * 70
+
+def msg(message):
+ print >>sys.stderr, "*" * 3, message
+
+def check_twisted_version():
+ """Check twisted is installed with a supported version and print a warning if not.
+ Raises an error if twisted is not installed.
+ """
+ # Supported twisted release and major version.
+ RELEASE = 1
+ MAJOR = 3
+ try:
+ from twisted.copyright import version
+ except ImportError:
+ hline()
+ msg("The Twisted framework is not installed.")
+ msg("Use 'make install-twisted' at the xen root to install.")
+ msg("")
+ msg("Alternatively download and install version %d.%d or higher" % (RELEASE, MAJOR))
+ msg("from http://www.twistedmatrix.com/products")
+ hline()
+ sys.exit(1)
+
+ (release, major, minor) = version.split('.')
+ release = int(release)
+ major = int(major)
+ if release > RELEASE: return
+ if release == RELEASE and major >= MAJOR: return
+ hline()
+ msg("Warning: Twisted version not supported: %s" % version)
+ msg("Use Twisted version %d.%d.0 or higher" % (RELEASE, MAJOR))
+ hline()
+ sys.exit(1)
+
+if __name__ == '__main__':
+ check_twisted_version()
+
--- /dev/null
+#!/bin/bash
+# CHECK-BUILD
+
+function error {
+ echo 'Check for zlib includes failed.'
+ exit 1
+}
+
+set -e
+[ -e /usr/include/zlib.h ] || error
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+# CHECK-BUILD CHECK-INSTALL
+
+function error {
+ echo 'Check for zlib library failed.'
+ exit 1
+}
+
+set -e
+ldconfig -p | grep libz.so || error
\ No newline at end of file
--- /dev/null
+#!/bin/bash
+
+function usage {
+ echo "Usage:"
+ echo "\t$0 [build|install|clean]"
+ echo
+ echo "Check suitability for Xen build or install."
+ echo "Exit with 0 if OK, 1 if not."
+ echo "Prints only failed tests."
+ echo
+ echo "Calling with 'clean' removes generated files."
+ exit 1
+}
+
+case $1 in
+ build)
+ check="CHECK-BUILD"
+ info=".chkbuild"
+ ;;
+ install)
+ check="CHECK-INSTALL"
+ info=".chkinstall"
+ ;;
+ clean)
+ rm -f .chkbuild .chkinstall
+ exit 0
+ ;;
+ *)
+ usage
+ ;;
+esac
+
+failed=0
+
+echo "Xen ${check} " $(date) > ${info}
+for f in check_* ; do
+ case $f in
+ *~)
+ continue
+ ;;
+ *)
+ ;;
+ esac
+ if ! [ -x $f ] ; then
+ continue
+ fi
+ if ! grep -q ${check} $f ; then
+ continue
+ fi
+ echo ' ' >> ${info}
+ echo "Checking $f" >> ${info}
+ if ./$f 1>>${info} 2>&1 ; then
+ echo OK >> ${info}
+ else
+ failed=1
+ echo "FAILED $f"
+ echo FAILED >> ${info}
+ fi
+done
+
+echo >> ${info}
+
+if [ "$failed" == "1" ] ; then
+ echo "Checks failed. See ${info} for details."
+ echo "FAILED" >> ${info}
+ exit 1
+else
+ echo "OK" >> ${info}
+ exit 0
+fi
\ No newline at end of file